import {
  createRouter,
  createWebHashHistory
} from 'vue-router'
import Layout from '@/views/Layout/index.vue'

const routes = [{
  path: '/login',
  component: () => import('@/views/Login/index.vue')
},
{
  path: '/',
  component: Layout,
  children: [
    {
      path: '',
      component: () => import('@/views/Home/index.vue')
    },
    {
      path: 'category',
      component: () => import('@/views/Category/index.vue')
    },
    {
      path: 'category/sub',
      component: () => import('@/views/Category/Sub.vue')
    },
    {
      path: 'product',
      component: () => import('@/views/Product/index.vue')
    }
  ]
}
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
